﻿<?xml version="1.0" encoding="utf-8"?>
<WITD application="Work item type editor" version="1.0" xmlns="http://schemas.microsoft.com/VisualStudio/2008/workitemtracking/typedef">
  <WORKITEMTYPE xmlns="" name="Bug">
    <DESCRIPTION>Acceptance Test failure.</DESCRIPTION>
    <FIELDS>
      <FIELD name="System Info" refname="Microsoft.VSTS.TCM.SystemInfo" type="HTML" >
        <HELPTEXT>Test context, provided automatically by test</HELPTEXT>
      </FIELD>
      <FIELD name="ReproSteps" refname="Microsoft.VSTS.TCM.ReproSteps" type="HTML">
        <HELPTEXT>How to see the bug. End by contrasting expected with actual behavior</HELPTEXT>
      </FIELD>
      <FIELD type="String" name="Title" refname="System.Title">
        <HELPTEXT>Name or short description that clearly describes the details of the failure</HELPTEXT>
        <REQUIRED />
        <CANNOTLOSEVALUE />
      </FIELD>
      <FIELD type="String" name="State" refname="System.State">
        <HELPTEXT>This is the status of the Bug as selected by a team member</HELPTEXT>
      </FIELD>
      <FIELD type="String" name="Assigned To" refname="System.AssignedTo" syncnamechanges="true">
        <HELPTEXT>Required for MTLM support</HELPTEXT>
        <ALLOWEDVALUES expanditems="true" filteritems="excludegroups">
          <LISTITEM value="[project]\Project Administrators" />
          <LISTITEM value="[project]\Contributors" />
        </ALLOWEDVALUES>
      </FIELD>
      <FIELD reportable="dimension" type="String" name="Found In" refname="Microsoft.VSTS.Build.FoundIn">
        <HELPTEXT>The build in which the bug was found</HELPTEXT>
        <SUGGESTEDVALUES>
          <LISTITEM value="&lt;None&gt;" />
        </SUGGESTEDVALUES>
      </FIELD>
      <FIELD reportable="dimension" type="String" name="Integration Build" refname="Microsoft.VSTS.Build.IntegrationBuild">
        <HELPTEXT>The build in which the bug was fixed</HELPTEXT>
        <SUGGESTEDVALUES>
          <LISTITEM value="&lt;None&gt;" />
        </SUGGESTEDVALUES>
      </FIELD>
      <FIELD type="PlainText" name="Description" refname="System.Description">
        <HELPTEXT>Detailed description of the bug</HELPTEXT>
      </FIELD>
      <FIELD type="History" name="History" refname="System.History">
        <HELPTEXT>Discussion thread and other historical information including fields that have changed, by whom and when.</HELPTEXT>
      </FIELD>
      <FIELD reportable="dimension" type="String" name="Testing Impact (Scrum v3)" refname="Scrum.v3.TestingImpact">
        <HELPTEXT>The testing impact of the bug (1=highest, 5=lowest)</HELPTEXT>
        <REQUIRED />
        <ALLOWEDVALUES>
          <LISTITEM value="1 - Blocking" />
          <LISTITEM value="2 - Critical" />
          <LISTITEM value="3 - High" />
          <LISTITEM value="4 - Medium" />
          <LISTITEM value="5 - Low" />
        </ALLOWEDVALUES>
        <DEFAULT from="value" value="3 - High" />
      </FIELD>
      <FIELD type="TreePath" name="Area Path" refname="System.AreaPath">
        <HELPTEXT>The area of the product with which this bug is associated</HELPTEXT>
      </FIELD>
      <FIELD type="Integer" name="ID" refname="System.Id">
        <HELPTEXT>Human readable, auto-populated numeric Id</HELPTEXT>
      </FIELD>
      <FIELD reportable="dimension" type="DateTime" name="History Date (Scrum v3)" refname="Scrum.v3.HistoryDate">
        <COPY from="clock" />
        <DEFAULT from="clock" />
      </FIELD>
      <FIELD type="PlainText" name="Replication Action Details (Scrum v3)" refname="Scrum.v3.ReplicationActionDetail" />

      <FIELD name="Closed Date" refname="Microsoft.VSTS.Common.ClosedDate" type="DateTime" reportable="dimension">
        <WHENNOTCHANGED field="System.State">
          <READONLY />
        </WHENNOTCHANGED>
      </FIELD>
      <FIELD name="Closed By" refname="Microsoft.VSTS.Common.ClosedBy" type="String" reportable="dimension" syncnamechanges="true">
        <WHENNOTCHANGED field="System.State">
          <READONLY />
        </WHENNOTCHANGED>
        <ALLOWEXISTINGVALUE />
      </FIELD>

      <FIELD name="Activated Date" refname="Microsoft.VSTS.Common.ActivatedDate" type="DateTime" reportable="dimension">
        <WHENNOTCHANGED field="System.State">
          <READONLY />
        </WHENNOTCHANGED>
      </FIELD>
      <FIELD name="Activated By" refname="Microsoft.VSTS.Common.ActivatedBy" type="String" reportable="dimension" syncnamechanges="true">
        <WHENNOTCHANGED field="System.State">
          <READONLY />
        </WHENNOTCHANGED>
        <ALLOWEXISTINGVALUE />
      </FIELD>

      <FIELD reportable="dimension" type="String" name="Bug Origin" refname="Scrum.v3.BugOrigin">
        <HELPTEXT>Identifies whether this bug originated from Team Build or remain unset if from Team Explorer or through the API.</HELPTEXT>
        <DEFAULT from="value" value="User"/>
      </FIELD>
      
    </FIELDS>
    <WORKFLOW>
      <STATES>
        <STATE value="Active">
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <EMPTY />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
              <EMPTY />
            </FIELD>
            <FIELD refname="System.AssignedTo">
              <DEFAULT from="currentuser" />
            </FIELD>
          </FIELDS>
        </STATE>

        <STATE value="Closed" />

        <STATE value="Ready for Test" />

        <STATE value="Ignored" />

        <STATE value="Deleted" />
      </STATES>

      <TRANSITIONS>
        <TRANSITION from="" to="Active">
          <REASONS>
            <DEFAULTREASON value="New Bug Discovered" />
            <REASON value="Build Failure" />
          </REASONS>
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedBy">
              <COPY from="currentuser" />
              <VALIDUSER />
              <REQUIRED />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedDate">
              <SERVERDEFAULT from="clock" />
            </FIELD>
          </FIELDS>
        </TRANSITION>

        <TRANSITION from="Active" to="Ready for Test">
          <REASONS>
            <DEFAULTREASON value="A fix is ready for testing" />
          </REASONS>
        </TRANSITION>

        <TRANSITION from="Active" to="Closed">
          <REASONS>
            <DEFAULTREASON value="Resolved" />
          </REASONS>
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedDate">
              <READONLY />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedBy">
              <READONLY />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <SERVERDEFAULT from="clock" />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
              <COPY from="currentuser" />
              <VALIDUSER />
              <REQUIRED />
            </FIELD>
          </FIELDS>
        </TRANSITION>

        <TRANSITION from="Ready for Test" to="Active">
          <REASONS>
            <DEFAULTREASON value="Reactivated" />
          </REASONS>
        </TRANSITION>

        <TRANSITION from="Ready for Test" to="Closed">
          <REASONS>
            <DEFAULTREASON value="Resolved" />
          </REASONS>
        </TRANSITION>

        <TRANSITION from="Ready for Test" to="Deleted">
          <REASONS>
            <DEFAULTREASON value="Item has been marked for deletion" />
          </REASONS>
        </TRANSITION>

        <TRANSITION from="Closed" to="Deleted">
          <REASONS>
            <DEFAULTREASON value="Item has been marked for deletion" />
          </REASONS>
        </TRANSITION>

        <TRANSITION from="Active" to="Deleted">
          <REASONS>
            <DEFAULTREASON value="Item has been marked for deletion" />
          </REASONS>
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedDate">
              <READONLY />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedBy">
              <READONLY />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <READONLY />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
              <READONLY />
            </FIELD>
          </FIELDS>
        </TRANSITION>

        <TRANSITION from="Deleted" to="Active">
          <REASONS>
            <DEFAULTREASON value="Item has been marked for restoration" />
          </REASONS>
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedBy">
              <COPY from="currentuser" />
              <VALIDUSER />
              <REQUIRED />
            </FIELD>
          </FIELDS>
        </TRANSITION>

        <TRANSITION from="Active" to="Ignored">
          <REASONS>
            <DEFAULTREASON value="Item has been ignored" />
          </REASONS>
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedDate">
              <READONLY />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedBy">
              <READONLY />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <READONLY />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
              <READONLY />
            </FIELD>
          </FIELDS>
        </TRANSITION>

        <TRANSITION from="Ignored" to="Deleted">
          <REASONS>
            <DEFAULTREASON value="Item has been marked for deletion" />
          </REASONS>
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedDate">
              <READONLY />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedBy">
              <READONLY />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <READONLY />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
              <READONLY />
            </FIELD>
          </FIELDS>
        </TRANSITION>

        <TRANSITION from="Deleted" to="Ignored">
          <REASONS>
            <DEFAULTREASON value="Item has been marked for restoration" />
          </REASONS>
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedDate">
              <READONLY />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedBy">
              <READONLY />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <READONLY />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
              <READONLY />
            </FIELD>
          </FIELDS>
        </TRANSITION>

        <TRANSITION from="Deleted" to="Ready for Test">
          <REASONS>
            <DEFAULTREASON value="Item has been marked for restoration" />
          </REASONS>
        </TRANSITION>
      </TRANSITIONS>
      
    </WORKFLOW>
    <FORM>
      <Layout>
        <Group>
          <Column PercentWidth="100">
            <Control FieldName="System.Title" Type="FieldControl" Label="Title" LabelPosition="Left" />
          </Column>
        </Group>
        <Group>
          <Column PercentWidth="50">
            <Group Label="Status">
              <Column PercentWidth="100">
                <Control FieldName="Scrum.v3.TestingImpact" Type="FieldControl" Label="Testing Impact" LabelPosition="Left" />
                <Control FieldName="System.State" Type="FieldControl" Label="State" LabelPosition="Left" />
              </Column>
            </Group>
          </Column>
          <Column PercentWidth="50">
            <Group Label="Classification">
              <Column PercentWidth="100">
                <Control FieldName="System.AreaPath" Type="WorkItemClassificationControl" Label="Area" LabelPosition="Left" />
                <Control FieldName="System.IterationPath" Type="WorkItemClassificationControl" Label="Iteration" LabelPosition="Left" />
              </Column>
            </Group>
          </Column>
        </Group>
        <Group>
          <Column PercentWidth="50">
            <Group Label="Activated">
              <Column PercentWidth="50">
                <Control FieldName="Microsoft.VSTS.Common.ActivatedDate" Type="DateTimeControl" Label="Date found" LabelPosition="Left" />
                <Control FieldName="Microsoft.VSTS.Common.ActivatedBy" Type="FieldControl" Label="Activated by" LabelPosition="Left" />
              </Column>
            </Group>
          </Column>
          <Column PercentWidth="50">
            <Group Label="Closed">
              <Column PercentWidth="50">
                <Control FieldName="Microsoft.VSTS.Common.ClosedDate" Type="DateTimeControl" Label="Date closed" LabelPosition="Left" />
                <Control FieldName="Microsoft.VSTS.Common.ClosedBy" Type="FieldControl" Label="Closed by" LabelPosition="Left" />
              </Column>
            </Group>
          </Column>
        </Group>
        <TabGroup>
          <Tab Label="Bug Details">
            <Group>
              <Column PercentWidth="50">
                <Group Label="Found">
                  <Column PercentWidth="100">
                    <Control FieldName="Microsoft.VSTS.Build.FoundIn" Type="FieldControl" Label="In Build" LabelPosition="Left" Dock="Bottom" />
                  </Column>
                </Group>
              </Column>
              <Column PercentWidth="50">
                <Group Label="Fixed">
                  <Column PercentWidth="100">
                    <Control FieldName="Microsoft.VSTS.Build.IntegrationBuild" Type="FieldControl" Label="In Build" LabelPosition="Left" Dock="Bottom" />
                  </Column>
                </Group>
              </Column>
            </Group>
            <Group Label="Description">
              <Column PercentWidth="100">
                <Control FieldName="System.Description" Type="HtmlFieldControl" Label="Description:" LabelPosition="Top" Dock="Fill" />
              </Column>
            </Group>
          </Tab>
          <Tab Label="Bug Reproduction">
            <Group>
              <Column PercentWidth="50">
                <Control FieldName="Microsoft.VSTS.TCM.SystemInfo" Type="HtmlFieldControl" Label="System Info:" LabelPosition="Top" Dock="Fill" />
              </Column>
              <Column PercentWidth="50">
                <Control FieldName="Microsoft.VSTS.TCM.ReproSteps" Type="ReproStepsControl" Label="Steps to Reproduce" LabelPosition="Top" Dock="Fill"/>
              </Column>
            </Group>
          </Tab>
          <Tab Label="History">
            <Group>
              <Column PercentWidth="50">
                <Group>
                  <Column PercentWidth="100">
                    <Control FieldName="System.History" Type="WorkItemLogControl" Label="History:" LabelPosition="Top" Dock="Fill" />
                  </Column>
                </Group>
              </Column>
            </Group>
          </Tab>
          <Tab Label="Fails">
            <Control Type="LinksControl" Name="LinkedAcceptanceTests" Label="The tests failed by this bug:" LabelPosition="Top">
              <LinksControlOptions>
                <WorkItemLinkFilters FilterType="include">
                  <Filter LinkType="Scrum.FailedBy" FilterOn="reversename" />
                </WorkItemLinkFilters>
                <WorkItemTypeFilters FilterType="include">
                  <Filter WorkItemType="Acceptance Test" />
                </WorkItemTypeFilters>
                <ExternalLinkFilters FilterType="excludeAll"/>
                <LinkColumns>
                  <LinkColumn RefName="System.ID" />
                  <LinkColumn RefName="System.Links.LinkType" />
                  <LinkColumn RefName="System.WorkItemType" />
                  <LinkColumn RefName="System.Title" />
                  <LinkColumn RefName="System.State" />
                  <LinkColumn LinkAttribute="System.Links.Comment" />
                </LinkColumns>
              </LinksControlOptions>
            </Control>
          </Tab>
          <Tab Label="All Links">
            <Control Type="LinksControl" Name="OtherLinks">
              <LinksControlOptions>
                <LinkColumns>
                  <LinkColumn RefName="System.ID" />
                  <LinkColumn RefName="System.Links.LinkType" />
                  <LinkColumn RefName="System.WorkItemType" />
                  <LinkColumn RefName="System.Title" />
                  <LinkColumn RefName="System.AssignedTo" />
                  <LinkColumn RefName="System.State" />
                  <LinkColumn LinkAttribute="System.Links.Comment" />
                </LinkColumns>
              </LinksControlOptions>
            </Control>
          </Tab>
          <Tab Label="File Attachments/Screenshots">
            <Control Type="AttachmentsControl" LabelPosition="Left" />
          </Tab>
          <Tab Label="Process Guidance">
            <Control Type="WebpageControl" LabelPosition="Top" Dock="Fill">
              <WebpageControlOptions AllowScript="false">
                <Link UrlRoot="http://www.scrumforteamsystem.com/" UrlPath="/processguidance/v3/{0}/{1}" >
                  <Param Index="0" Value="System.WorkItemType" Type="Current" />
                  <Param Index="1" Value="System.State" Type="Current"/>
                </Link>
              </WebpageControlOptions>
            </Control>
          </Tab>
        </TabGroup>
      </Layout>
    </FORM>
  </WORKITEMTYPE>
</WITD>